#include "../schedule.h"
#include "../process.h"
#include <stdio.h>

struct schedFuncTable *simSchedTab;


int main (int argc, char** argv)
{
	struct process *first;
	struct process *second;
	struct process *third;

	simSchedTab = &expSchedTab;
	simSchedTab->init();

	first = proc_create("#1", 20, 100, 8000);
	second = proc_create("#2", 20, 120, 8000);
	third = proc_create("#3", 20, 8, 9000);


	simSchedTab->add(first);
	simSchedTab->add(second);
	simSchedTab->add(third);
	
	printf("%d\n", simSchedTab->time_to_event());
	first = simSchedTab->schedule();
	
	printf("%d\n", simSchedTab->time_to_event());
	second = simSchedTab->schedule();

	printf("done: %d\n", simSchedTab->done());
	printf("%d\n", simSchedTab->time_to_event());
	third = simSchedTab->schedule();
	
	printf("done: %d\n", simSchedTab->done());

	simSchedTab->add(second);

	printf("done: %d\n", simSchedTab->done());

	simSchedTab->schedule();

	printf("done: %d\n", simSchedTab->done());
	
	printf("%d, %d, %d\n", first->lifeTime, second->lifeTime
				, third->lifeTime);
	

	return 0;
}

int sim_get_clock()
{
	return 0;
}

